// user模型
// user和公众账号绑定, 每个用户在公众账号里面是一个user

var mongoose = require('mongoose');
var Schema = mongoose.Schema;

var userSchema = new Schema({
  sn: { type: Number, unique: true },
  wxOpenId: { type: String, unique: true },
  name: String,
  gender: { type: Number, default: 0 },
  avatar: String,
  language: String,
  city: String,
  province: String,
  country: String,
  startAt: Date,
  endAt: Date,
  interval: Number,
  status: { type: Number, default: 0 },
  bindUserId: Schema.Types.ObjectId,
});

var User = mongoose.model('User', userSchema);

module.exports = User;
